﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IronOne.SalesOne.SalesOneWeb.ContactManagement
{
    public partial class SuspectDetails : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    if (!string.IsNullOrEmpty(Request.UrlReferrer.ToString()))
                    {
                        ViewState["refUrl"] = Request.UrlReferrer.ToString();
                    }

                }

                if (Session["SuspObj"] != null)
                {
                    GridViewRow susRow = (GridViewRow)Session["SuspObj"];

                    lblId.Text = susRow.Cells[2].Text;
                    lblName.Text = susRow.Cells[4].Text;
                    lblDateOfBirth.Text = susRow.Cells[10].Text;
                    lblMaritalStatus.Text = susRow.Cells[12].Text;
                    lblHomeAddressLine1.Text = susRow.Cells[20].Text;
                    lblHomeAddressLine2.Text = susRow.Cells[21].Text;
                    lblCity.Text = susRow.Cells[23].Text;
                    lblCountry.Text = susRow.Cells[13].Text;
                    lblPreferredNoToCall.Text = susRow.Cells[26].Text;
                    lblRemarks.Text = susRow.Cells[24].Text;

                    lblOtherName.Text = susRow.Cells[5].Text;
                    lblGender.Text = susRow.Cells[22].Text;
                    lblProfession.Text = susRow.Cells[12].Text;
                    lblHomePhoneNo.Text = susRow.Cells[15].Text;
                    lblOfficePhoneNo.Text = susRow.Cells[16].Text;
                    lblMObilePhoneNo.Text = susRow.Cells[18].Text;
                    lblEmail.Text = susRow.Cells[17].Text;
                    lblPreferredPlaceToMeet.Text = susRow.Cells[25].Text;

                    Session.Remove("SuspObj");
                }
            }
            catch (Exception)
            {

            }
            

        }

        protected void cancelButton_Click(object sender, EventArgs e)
        {
            try
            {
                Response.Redirect(ViewState["refUrl"].ToString());
            }
            catch (Exception)
            {

            }
            
        }
    }
}
